import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isScreenShow: false,
    isAddressShow: false,
    n: false,
    navState: 0
  },
  mutations: {
    isScreenShow(state, bool) {
      state.isScreenShow = bool
    },
    isAddressShow(state, bool) {
      state.isAddressShow = bool
    },
    changeN(state) {
      state.n = true;
    },
    setNav(state, data) { //设置导航
      state.navState = data
    }
  },
  actions: {
    screenShow({ commit }, bool) {
      commit('isScreenShow', bool)
    },
    addressShow({ commit }, bool) {
      commit('isAddressShow', bool)
    },
    setNavIndex({ commit }, index) {
      commit('setNav', index)
    }
  },
  modules: {
    
  }
})
